home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / giochi / amigainf.lha / Inform / library / grammar.h < prev    next >
Text File  |  1995-08-02  |  17KB  |  369 lines

  1. ! ----------------------------------------------------------------------------
  2. !  GRAMMAR:  Grammar table entries for the standard verbs library.
  3. !
  4. !  Supplied for use with Inform 5                         Serial number 950703
  5. !                                                                 Release 5/11
  6. !  (c) Graham Nelson 1993, 1994, 1995, but freely usable (see documentation)
  7. ! ----------------------------------------------------------------------------
  8. !  The "meta-verbs", commands to the game rather than in the game, come first:
  9. ! ----------------------------------------------------------------------------
  10.  
  11. Verb meta "score"
  12.                 *                                -> Score;
  13. Verb meta "fullscore" "full"
  14.                 *                                -> FullScore
  15.                 * "score"                        -> FullScore;
  16. Verb meta "q" "quit" "die"
  17.                 *                                -> Quit;
  18. Verb meta "restore"
  19.                 *                                -> Restore;
  20. Verb meta "restart"
  21.                 *                                -> Restart;
  22. Verb meta "verify"
  23.                 *                                -> Verify;
  24. Verb meta "save"
  25.                 *                                -> Save;
  26. Verb meta "script"
  27.                 *                                -> ScriptOn
  28.                 * "off"                          -> ScriptOff
  29.                 * "on"                           -> ScriptOn;
  30. Verb meta "noscript" "unscript"
  31.                 *                                -> ScriptOff;
  32. Verb meta "superbrief" "short"
  33.                 *                                -> LMode3;
  34. Verb meta "verbose" "long"
  35.                 *                                -> LMode2;
  36. Verb meta "brief" "normal"
  37.                 *                                -> LMode1;
  38. Verb meta "pronouns" "nouns"
  39.                 *                                -> Pronouns;
  40. Verb meta "notify"
  41.                 * "on"                           -> NotifyOn
  42.                 * "off"                          -> NotifyOff;
  43. Verb meta "version"
  44.                 *                                -> Version;
  45. #IFNDEF NO_PLACES;
  46. Verb meta "places"
  47.                 *                                -> Places;
  48. Verb meta "objects"
  49.                 *                                -> Objects;
  50. #ENDIF;
  51.  
  52. ! ----------------------------------------------------------------------------
  53. !  Debugging grammar
  54. ! ----------------------------------------------------------------------------
  55.  
  56. #ifdef DEBUG;
  57. Verb meta "trace"
  58.                 *                                -> TraceOn
  59.                 * number                         -> TraceLevel
  60.                 * "on"                           -> TraceOn
  61.                 * "off"                          -> TraceOff;
  62. Verb meta "actions"
  63.                 *                                -> ActionsOn
  64.                 * "on"                           -> ActionsOn
  65.                 * "off"                          -> ActionsOff;
  66. Verb meta "routines"
  67.                 *                                -> RoutinesOn
  68.                 * "on"                           -> RoutinesOn
  69.                 * "off"                          -> RoutinesOff;
  70. Verb meta "timers" "daemons"
  71.                 *                                -> TimersOn
  72.                 * "on"                           -> TimersOn
  73.                 * "off"                          -> TimersOff;
  74. Verb meta "recording"
  75.                 *                                -> CommandsOn
  76.                 * "on"                           -> CommandsOn
  77.                 * "off"                          -> CommandsOff;
  78. Verb meta "replay"
  79.                 *                                -> CommandsRead;
  80. Verb meta "random"
  81.                 *                                -> Predictable;
  82. Verb meta "purloin"
  83.                 * multi                          -> XPurloin;
  84. Verb meta "abstract"
  85.                 * noun "to" noun                 -> XAbstract;
  86. Verb meta "tree"
  87.                 *                                -> XTree
  88.                 * noun                           -> XTree;
  89. Verb meta "goto"
  90.                 * number                         -> Goto;
  91. Verb meta "gonear"
  92.                 * noun                           -> Gonear;
  93. #endif;
  94.  
  95. ! ----------------------------------------------------------------------------
  96. !  And now the game verbs.
  97. ! ----------------------------------------------------------------------------
  98.  
  99. Verb "take" "get" "carry" "hold"
  100.                 * "out"                          -> Exit
  101.                 * "off"                          -> Exit
  102.                 * "up"                           -> Exit
  103.                 * multi                          -> Take
  104.                 * multiinside "from" noun        -> Remove
  105.                 * "in" noun                      -> Enter
  106.                 * "into" noun                    -> Enter
  107.                 * "on" noun                      -> Enter
  108.                 * multiinside "off" noun         -> Remove
  109.                 * "off" worn                     -> Disrobe
  110.                 * "off" noun                     -> GetOff
  111.                 * "inventory"                    -> Inv;
  112. Verb "pick"
  113.                 * "up" multi                     -> Take;
  114. Verb "stand"
  115.                 *                                -> Exit
  116.                 * "up"                           -> Exit
  117.                 * "on" noun                      -> Enter;
  118. Verb "remove"
  119.                 * held                           -> Disrobe
  120.                 * multi                          -> Take
  121.                 * multiinside "from" noun        -> Remove;
  122. Verb "shed" "doff" "disrobe"
  123.                 * held                           -> Disrobe; 
  124. Verb "wear" "don"
  125.                 * held                           -> Wear;
  126. Verb "put"
  127.                 * multiexcept "in" noun          -> Insert
  128.                 * multiexcept "inside" noun      -> Insert
  129.                 * multiexcept "into" noun        -> Insert
  130.                 * multiexcept "on" noun          -> PutOn
  131.                 * multiexcept "onto" noun        -> PutOn
  132.                 * "on" held                      -> Wear
  133.                 * "down" multiheld               -> Drop
  134.                 * multiheld "down"               -> Drop;
  135. Verb "insert"
  136.                 * multiexcept "in" noun          -> Insert
  137.                 * multiexcept "into" noun        -> Insert;
  138. Verb "empty"
  139.                 * noun                           -> Empty
  140.                 * "out" noun                     -> Empty
  141.                 * noun "out"                     -> Empty
  142.                 * noun "to" noun                 -> EmptyT
  143.                 * noun "into" noun               -> EmptyT
  144.                 * noun "on" noun                 -> EmptyT
  145.                 * noun "onto" noun               -> EmptyT;
  146. Verb "transfer"
  147.                 * noun "to" noun                 -> Transfer;
  148. Verb "drop" "throw" "discard"
  149.                 * multiheld                      -> Drop
  150.                 * multiexcept "in" noun          -> Insert
  151.                 * multiexcept "into" noun        -> Insert
  152.                 * multiexcept "on" noun          -> PutOn
  153.                 * multiexcept "onto" noun        -> PutOn
  154.                 * multiexcept "down" noun        -> Insert
  155.                 * held "at" noun                 -> ThrowAt
  156.                 * held "against" noun            -> ThrowAt;
  157. Verb "give" "pay" "offer" "feed"
  158.                 * creature held                  -> GiveR
  159.                 * held "to" creature             -> Give
  160.                 * "over" held "to" creature      -> Give;
  161. Verb "show" "present" "display"
  162.                 * creature held                  -> ShowR
  163.                 * held "to" creature             -> Show;
  164. Verb "go" "walk" "run" "leave"
  165.                 *                                -> VagueGo
  166.                 * direction                      -> Go
  167.                 * noun                           -> Enter
  168.                 * "into" noun                    -> Enter
  169.                 * "in" noun                      -> Enter
  170.                 * "inside" noun                  -> Enter
  171.                 * "through" noun                 -> Enter;
  172. Verb "inventory" "inv" "i"
  173.                 *                                -> Inv
  174.                 * "tall"                         -> InvTall
  175.                 * "wide"                         -> InvWide;
  176.  
  177. [ ConTopic w; consult_from = wn;
  178.   do w=NextWordStopped(); until (w==-1); consult_words = wn-consult_from;
  179.   if (consult_words--==1) return -1; return 0; ];
  180. [ ConTopicI w; consult_from = wn;
  181.   do w=NextWordStopped(); until (w=='in' or -1); if (w==-1) return -1;
  182.   wn--; consult_words = wn-consult_from;
  183.   if (consult_words==0) return -1; return 0; ];
  184.  
  185. Verb "look" "l"
  186.                 *                                -> Look
  187.                 * "at" noun                      -> Examine
  188.                 * "inside" noun                  -> Search
  189.                 * "in" noun                      -> Search
  190.                 * "into" noun                    -> Search
  191.                 * "under" noun                   -> LookUnder
  192.                 * "through" noun                 -> Search
  193.                 * "up" ConTopicI "in" noun       -> Consult;
  194. Verb "consult"  * noun "about" ConTopic          -> Consult
  195.                 * noun "on" ConTopic             -> Consult;
  196. Verb "open" "unwrap" "uncover" "undo"
  197.                 * noun                           -> Open
  198.                 * noun "with" held               -> Unlock;
  199. Verb "close" "shut" "cover"
  200.                 * noun                           -> Close
  201.                 * "up"                           -> Close
  202.                 * "off" noun                     -> SwitchOff;
  203. Verb "enter" "cross"
  204.                 *                                -> GoIn
  205.                 * noun                           -> Enter;
  206. Verb "sit" "lie"
  207.                 * "on" noun                      -> Enter
  208.                 * "in" noun                      -> Enter
  209.                 * "inside" noun                  -> Enter;
  210. Verb "in" "inside"
  211.                 *                                -> GoIn;
  212. Verb "exit" "out" "outside"
  213.                 *                                -> Exit;
  214. Verb "examine" "x" "watch" "describe" "check"
  215.                 * noun                           -> Examine;
  216. Verb "read"
  217.                 * noun                           -> Examine
  218.                 * "about" ConTopicI "in" noun    -> Consult
  219.                 * ConTopicI "in" noun            -> Consult;
  220. Verb "yes" "y"
  221.                 *                                -> Yes;
  222. Verb "no"
  223.                 *                                -> No;
  224. Verb "sorry"
  225.                 *                                -> Sorry;
  226. Verb "shit" "fuck" "damn" "sod"
  227.                 *                                -> Strong
  228.                 * special                        -> Strong;
  229. Verb "bother" "curses" "drat" "darn"
  230.                 *                                -> Mild
  231.                 * special                        -> Mild;
  232. Verb "search"
  233.                 * noun                           -> Search;
  234. Verb "wave"
  235.                 *                                -> WaveHands
  236.                 * noun                           -> Wave;
  237. Verb "set" "adjust"
  238.                 * noun                           -> Set
  239.                 * noun "to" special              -> SetTo;
  240. Verb "pull" "drag"
  241.                 * noun                           -> Pull;
  242. Verb "push" "move" "shift" "clear" "press"
  243.                 * noun                           -> Push
  244.                 * noun noun                      -> PushDir
  245.                 * noun "to" noun                 -> Transfer;
  246. Verb "turn" "rotate" "twist" "unscrew" "screw"
  247.                 * noun                           -> Turn
  248.                 * noun "on"                      -> Switchon
  249.                 * noun "off"                     -> Switchoff
  250.                 * "on" noun                      -> Switchon
  251.                 * "off" noun                     -> Switchoff;
  252. Verb "switch"
  253.                 * noun                           -> Switchon
  254.                 * noun "on"                      -> Switchon
  255.                 * noun "off"                     -> Switchoff
  256.                 * "on" noun                      -> Switchon
  257.                 * "off" noun                     -> Switchoff;
  258. Verb "lock"
  259.                 * noun "with" held               -> Lock;
  260. Verb "unlock"
  261.                 * noun "with" held               -> Unlock;
  262. Verb "attack" "break" "smash" "hit" "fight" "wreck" "crack"
  263.      "destroy" "murder" "kill" "torture" "punch" "thump"
  264.                 * noun                           -> Attack;
  265. Verb "wait" "z"
  266.                 *                                -> Wait;
  267. Verb "answer" "say" "shout" "speak"
  268.                 * special "to" creature          -> Answer;
  269. Verb "tell"
  270.                 * creature "about" special       -> Tell;
  271. Verb "ask"
  272.                 * creature "about" special       -> Ask
  273.                 * creature "for" noun            -> AskFor;
  274. Verb "eat"
  275.                 * held                           -> Eat;
  276. Verb "sleep" "nap"
  277.                 *                                -> Sleep;
  278. Verb "peel"
  279.                 * noun                           -> Take
  280.                 * "off" noun                     -> Take;
  281. Verb "sing"
  282.                 *                                -> Sing;
  283. Verb "climb" "scale"
  284.                 * noun                           -> Climb
  285.                 * "up" noun                      -> Climb
  286.                 * "over" noun                    -> Climb;
  287. Verb "buy" "purchase"
  288.                 * noun                           -> Buy;
  289. Verb "squeeze" "squash"
  290.                 * noun                           -> Squeeze;
  291. Verb "swim" "dive"
  292.                 *                                -> Swim;
  293. Verb "swing"
  294.                 * noun                           -> Swing
  295.                 * "on" noun                      -> Swing;
  296. Verb "blow"
  297.                 * held                           -> Blow;
  298. Verb "pray"
  299.                 *                                -> Pray;
  300. Verb "wake" "awake" "awaken"
  301.                 *                                -> Wake
  302.                 * "up"                           -> Wake
  303.                 * creature                       -> WakeOther
  304.                 * creature "up"                  -> WakeOther
  305.                 * "up" creature                  -> WakeOther;
  306. Verb "kiss" "embrace" "hug"
  307.                 * creature                       -> Kiss;
  308. Verb "think"
  309.                 *                                -> Think;
  310. Verb "smell" "sniff"
  311.                 *                                -> Smell
  312.                 * noun                           -> Smell;
  313. Verb "hear" "listen"
  314.                 *                                -> Listen
  315.                 * noun                           -> Listen
  316.                 * "to" noun                      -> Listen;
  317. Verb "taste"
  318.                 * noun                           -> Taste;
  319. Verb "touch" "fondle" "feel" "grope"
  320.                 * noun                           -> Touch;
  321. Verb "rub" "shine" "polish" "sweep" "clean" "dust" "wipe" "scrub"
  322.                 * noun                           -> Rub;
  323. Verb "tie" "attach" "fasten" "fix"
  324.                 * noun                           -> Tie
  325.                 * noun "to" noun                 -> Tie;
  326. Verb "burn" "light"
  327.                 * noun                           -> Burn
  328.                 * noun "with" held               -> Burn;
  329. Verb "drink" "swallow" "sip"
  330.                 * noun                           -> Drink;
  331. Verb "fill"
  332.                 * noun                           -> Fill;
  333. Verb "cut" "slice" "prune" "chop"
  334.                 * noun                           -> Cut;
  335. Verb "jump" "skip" "hop"
  336.                 *                                -> Jump
  337.                 * "over" noun                    -> JumpOver;
  338. Verb "dig"      * noun                           -> Dig
  339.                 * noun "with" held               -> Dig;
  340.  
  341. ! ----------------------------------------------------------------------------
  342. !  Final task: provide trivial routines if the user hasn't already:
  343. ! ----------------------------------------------------------------------------
  344.  
  345. #Stub TimePasses      0;
  346. #Stub Amusing         0;
  347. #Stub DeathMessage    0;
  348. #Stub DarkToDark      0;
  349. #Stub NewRoom         0;
  350. #Stub LookRoutine     0;
  351. #Stub AfterLife       0;
  352. #Stub GamePreRoutine  0;
  353. #Stub GamePostRoutine 0;
  354. #Stub PrintTaskName   1;
  355. #Stub InScope         1;
  356. #Stub UnknownVerb     1;
  357. #Stub PrintVerb       1;
  358. #Stub ParserError     1;
  359. #Stub ParseNumber     2;
  360. #Stub ChooseObjects   2;
  361. #IFNDEF PrintRank;
  362. Constant Make__PR;
  363. #ENDIF;
  364. #IFDEF Make__PR;
  365. [ PrintRank; "."; ];
  366. #ENDIF;
  367.  
  368. ! ----------------------------------------------------------------------------
  369.